//
//  HotTopicTableViewCell.m
//  项目
//
//  Created by 张诗雨 on 15/1/7.
//  Copyright (c) 2015年 张诗雨. All rights reserved.
//

#import "HotTopicTableViewCell.h"
#import "WebColor.h"
@implementation HotTopicTableViewCell
- (void)dealloc
{
    [super dealloc];
    [_contentLabel release];
    [_writerLabel release];
    [_titleLabel release];
    [_dateLabel release];
    [_counterLabel release];
}

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.frame = [[UIScreen mainScreen] bounds];
        
        UIImageView *whiteback = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bg_share_large.png"]];
        whiteback.frame = CGRectMake(10, 10, self.frame.size.width - 20, self.frame.size.height / 4 - 20);
        [self.contentView addSubview:whiteback];
        [whiteback release];
        
        self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.frame.size.width - 80, 30)];
        _titleLabel.font = [UIFont boldSystemFontOfSize:18.0f];
        [whiteback addSubview:_titleLabel];
        [_titleLabel release];
        self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(_titleLabel.frame.origin.x, _titleLabel.frame.origin.y + _titleLabel.frame.size.height + 10, self.frame.size.width - 40, 20)];
        _contentLabel.textColor = [WebColor slateGray];
        _contentLabel.font = [UIFont systemFontOfSize:16.0f];
        [whiteback addSubview:_contentLabel];
        [_contentLabel release];
        
        UIView *view = [[UIView alloc] initWithFrame:CGRectMake(_contentLabel.frame.origin.x,_contentLabel.frame.origin.y + 40, self.frame.size.width - 40 , 1)];
        view.backgroundColor = [WebColor darkOliveGreen];
        [whiteback addSubview:view];
        [view release];
        self.writerLabel = [[UILabel alloc] initWithFrame:CGRectMake(view.frame.origin.x, view.frame.origin.y + 5, self.frame.size.width * 2/ 3, 30)];
        _writerLabel.textColor = [WebColor slateBlue];
        _writerLabel.font = [UIFont systemFontOfSize:15.0f];
        [whiteback addSubview:_writerLabel];
        [_writerLabel release];
        UIImageView *countimg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconfont-pinglun.png"]];
        countimg.frame = CGRectMake(self.contentView.frame.size.width - 70, view.frame.origin.y + 5, 25, 25);
        [whiteback addSubview:countimg];
        [countimg release];
        self.counterLabel = [[UILabel alloc] initWithFrame:CGRectMake(countimg.frame.origin.x + 25, view.frame.origin.y + 5, 40, 30)];
        _counterLabel.textColor = [UIColor grayColor];
        _counterLabel.font = [UIFont systemFontOfSize:15.0f];
        [whiteback addSubview:_counterLabel];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
